<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <title>ThinkPHP框架</title>
    <meta name="desc" content="[desc]">
    <meta name="keywords" content="开源WEB开发框架">
    <link rel="icon" href="/favicon.ico">
    <link rel="stylesheet" href="/blog-doing/Public/Admin/css/vendor/bootstrap/dist/bootstrap.css">
    <link rel="stylesheet" href="/blog-doing/Public/Admin/css/vendor/Animate.css">
    <link rel="stylesheet" href="/blog-doing/Public/Admin/css/basic.css">
    <link rel="stylesheet" href="/blog-doing/Public/Admin/css/vendor/font_awesome/css/font-awesome.css">
    <link rel="stylesheet" href="/blog-doing/Public/Common/js/layui/css/layui.css">
    <link rel="stylesheet" href="/blog-doing/Public/Admin/js/wangEditor/dist/css/wangEditor.css">
    <link rel="stylesheet" href="/blog-doing/Public/Admin/js/uploadify/uploadify.css">
    <!--[if lt IE 9]>
    <script src="/blog-doing/Public/Admin/js/vendor/html5shiv.min.js"></script>
    <script src="/blog-doing/Public/Admin/js/vendor/respond.min.js"></script>
    <![endif]-->
    <script>
        window.common_conf = {
        };
    </script>
</head>

<body>
    <header id="page_header">
        <div class="logow animated fadeInLeft"><a href="#"><img src="/blog-doing/Public/Admin/logo.png" width="56"></a></div>
        <div class="right_side">
            <!--<span class="fullScreen_btn"><i class="fa fa-arrows-alt"></i></span>-->
            <a href="<?php echo U('Admin/Login/logout');?>"><span class="logout_btn"><i class="fa fa-sign-out"></i></span></a>
            <span class="toggleMenu_btn"><i class="fa fa-bars"></i></span>
        </div>
    </header>

<aside id="left_panel">
    <div class="login_info">
        <span>
            <div>
                <a href="#" data-toggle="dropdown">
                    <i class="fa fa-user"></i><span class="name"><?php echo ($username); ?></span><span class="caret"></span>
                </a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1" href="<?php echo U('Admin/UserInfo/index');?>">个人资料</a></li>
                    <li><a class="logout" tabindex="-1" href="<?php echo U('Admin/Login/logout');?>">退出</a></li>
                </ul>
            </div>
        </span>
    </div>
    <nav>
        <ul>
            <li>
                <a href="<?php echo U('Admin/Index/index');?>"><i class="fa fa-lg fa-fw fa-home"></i><span>工作台</span></a>
            </li>
            <?php if(is_array($nav)): $i = 0; $__LIST__ = $nav;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$nav): $mod = ($i % 2 );++$i;?><li>
                <?php if(empty($nav["childNav"])): ?><a href="/blog-doing/index.php?s=/<?php echo ($nav["m"]); ?>/<?php echo ($nav["c"]); ?>/<?php echo ($nav["f"]); ?>"><i class="fa fa-lg fa-fw fa-table"></i><span><?php echo ($nav["title"]); ?></span><b><i class="fa fa-plus-square-o"></i></b></a>
              <?php else: ?>
                <a href="#"><i class="fa fa-lg fa-fw fa-table"></i><span><?php echo ($nav["title"]); ?></span><b><i class="fa fa-plus-square-o"></i></b></a>
             <ul>
               <?php if(is_array($nav['childNav'])): $i = 0; $__LIST__ = $nav['childNav'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$childNav): $mod = ($i % 2 );++$i;?><a href="/blog-doing/index.php?s=/<?php echo ($childNav["m"]); ?>/<?php echo ($childNav["c"]); ?>/<?php echo ($childNav["f"]); ?>"><i class="fa fa-lg fa-fw fa-table"></i><span><?php echo ($childNav["title"]); ?></span><b><i class="fa fa-plus-square-o"></i></b></a><?php endforeach; endif; else: echo "" ;endif; ?>
           </ul><?php endif; ?>
              </li><?php endforeach; endif; else: echo "" ;endif; ?>
            <!-- <li>
                <a href="#"><i class="fa fa-lg fa-fw fa-table"></i><span>菜单管理</span><b><i class="fa fa-plus-square-o"></i></b></a>
                <ul>
                    <li><a href="<?php echo U('Admin/Menu/index');?>"><i class="fa fa-fw fa-file"></i><span>菜单列表</span></a></li>
                    <li><a href="<?php echo U('Admin/Menu/add');?>"><i class="fa fa-fw fa-file"></i><span>新增菜单</span></a></li>
                </ul>
            </li> -->

        </ul>
    </nav>
    <span class="minifyBtn"><i class="fa fa-arrow-circle-left"></i></span>
</aside>

<div id="main">
  <div class="content_wrapper">
<style media="screen">
  {
    display: inline;
  }
</style>
      <div class="container-fluid">
          <div class="row">
              <div class="col-sm-12">
                  <aside>
                      <header><i class="fa fa-fw fa-file"></i>文章分类</header>
                      <section>
                          <div class="container-fluid">
                              <div class="row">
                                  <div class="col-sm-12">
                                    <div class="btn-group" style="margin-bottom:20px;">
                                        <a class="btn btn-default" id="add-item"><i class="fa fa-file-o"></i>添加</a>
                                    </div>
                                      <div class="table-responsive">
                                          <table id="example" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                              <thead>
                                              <tr>
                                                  <th width="80">id</th>
                                                  <th width="160">分类名</th>
                                                  <!-- <th>父分类</th> -->
                                                  <th width="70">状态</th>
                                                  <th width="160">添加时间</th>
                                                  <th width="140">操作</th>
                                              </tr>
                                              </thead>
                                              <tbody>
                                                <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$list): $mod = ($i % 2 );++$i;?><tr>
                                                      <td><?php echo ($list["type_id"]); ?></td>
                                                      <td><?php echo ($list["title"]); ?></td>
                                                      <!-- <td><?php echo ($list["fMenu"]); ?></td> -->
                                                      <td><?php echo (getStatus($list["status"])); ?></td>
                                                      <td><?php echo (date("Y-m-d H:i",$list["create_time"])); ?></td>
                                                      <td>
                                                          <button type="button" class="btn btn-info btn-xs btn-change" attr-id="<?php echo ($list["type_id"]); ?>">修改</button>
                                                          <button type="button" class="btn btn-warning btn-xs btn-del" attr-id="<?php echo ($list["type_id"]); ?>">删除</button>
                                                      </td>
                                                  </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                                              </tbody>
                                          </table>
                                      </div>
                                      <nav>
                                          <ul class="pagination">
                                            <?php echo ($pageRes); ?>
                                          </ul>
                                      </nav>
                                  </div>
                              </div>
                          </div>
                      </section>
                  </aside>
              </div>
          </div>
      </div>

  </div>

</div>
<footer id="page_footer">
    <div class="inside"><i class="fa fa-copyright"></i><a href="https://github.com/liyu365">liyu</a></div>
</footer>
<script src="/blog-doing/Public/Admin/js/vendor/jquery.min.js"></script>
<script src="/blog-doing/Public/Admin/js/vendor/bootstrap/dist/bootstrap.js"></script>
<script src="/blog-doing/Public/Admin/js/basic.js"></script>
<script src="/blog-doing/Public/Common/js/layer/layer.js"></script>
<script src="/blog-doing/Public/Common/js/layui/layui.js"></script>
<script src="/blog-doing/Public/Common/js/dialog.js"></script>
<script src="/blog-doing/Public/Admin/js/common.js"></script>

<script type="text/javascript">
  var URL = {
    'add_url':"<?php echo U('Admin/NewsType/add');?>",
    'edit_url':"<?php echo U('Admin/NewsType/edit');?>",
    'del_url':"<?php echo U('Admin/NewsType/setStatus');?>",
    'jump_url':"<?php echo U('Admin/NewsType/index');?>",
  }
  $("#add-item").on('click',function(){
    layer.confirm('', {
      title:'请输入文章分类',
      content:'<label>文章分类：</label><input type=text name=title />',
      btn: ['确定','取消'] //按钮
    }, function(){
      var title = $('input[name=title]').val();
      $.post(URL.add_url,{'title':title},function(res){
        if(res.code ==200){
          return dialog.success(res.message,URL.jump_url);
        }
        if(res.code == 400){
          return dialog.error(res.message);
        }
      },'json');
    }, function(){
      layer.close();
  });
});
</script>
</body>
</html>